#include "Shm.hpp"
#include "Fifo.hpp"

int main()
{
    Shm shm(pathname, projid, CREATER);
    shm.Attr();
    NameFifo fifo(PATH, FILENAME);
    //文件操作
    FileOper readerfile(PATH, FILENAME);
    readerfile.OpenForRead();

    char *mem = (char *) shm.virtualAddr();
    while(true)
    {
        if(readerfile.Wait())
        {
            printf("%s\n", mem);
        }
        else 
            break;
    }

    readerfile.Close();
    std::cout << "server end normal!" << std::endl;//server段的析构函数没有被成功调用

    return 0;
}